
/**
 * 根据组织列表获取默认组织id及节点
 * @param {*} orgDatas 
 * @returns 
 */
export const getDefaultOrgIds = (orgDatas = []) => {
    const ids = [], nodes = [];
    
    const recusive = (datas) => {
        datas.forEach(data => {
            const { id, children } = data;
            
            if(children.length){
                recusive(children);
            }else{
                ids.push(id);
            }
            
            nodes.push(data);
        });
    };
    
    orgDatas.length && recusive(orgDatas);
    
    return {ids, nodes};
};